Process for the analog/digital conversion of an electric signal and device for implementing it

ABSTRACT

A process for the analog/digital conversion of an electric signal as well as a device for implementing the process is described. The process according to the invention provides that the time (T H , T L ) be determined, which, starting from a voltage (U X ) to be converted is necessary to charge up a RC component (10, 12) to a predetermined reference voltage, for example a switching threshold (S H , S L ) of a comparator (14) or to discharge it. The device according to the invention provides that a selector switch (13), the comparator (14) as well as a time detector (15) are components of a microprocessor (17), which is wired with the RC component (10, 12) as well as with an input resistor (11) if necessary. The process according to the invention as well as the device according to the invention are particularly easy to realize and are suitable for use especially with a microprocessor (17) which does not have an integrated analog/digital converter.

BACKGROUND OF THE INVENTION

The invention refers to a process for the analog/digital conversion ofan electric signal and a device for implementing the process. From thetechnical manual by U. Tietze and Ch. Schenk,"HALBLEITER-SCHALTUNGSTECHNIK" Semiconductor Circuit Engineering!, 2 ndedition 1971, pp 536-537, a process and a device for the analog/digitalconversion of an electric signal are known, which are based on a doubleintegrating precess. An integrator is set to the initial value zero in afirst integrating step. In a second integrating step, the input voltageto be converted is integrated upward by the integrator to apredetermined time. Following completion of this predetermined time, aknown reference voltage is fed to the integrator in a third process stepin place of the voltage to be converted, which then integrates downwarduntil the integrator once more reaches the initial value of zero. Thetime needed to integrate down is evaluated as a measure for the voltageto be converted. The elements required for the known double integratingprocess, for example an integrator, a comparator, a clock generator, acontrol logic as well as a counter are nowadays all components ofintegrated circuits.

SUMMARY OF THE INVENTION

It is the object of the invention to describe a process for theanalog/digital conversion of an electric signal as well as a device forimplementing this process, which can be realized simply, especially inconnection with a microprocessor.

The solution to this problem is achieved by a process which includes thesteps of connecting a capacitor with a first port to a fixed potential(GND), charging the capacitor up to a voltage to be converted bytransmitting the converted voltage to a second port of the capacitor,comparing the voltage at the capacitor to a reference voltage anddetermining a recharging direction by selecting an operating voltagefrom a variable voltage source, recharging the capacitor by connectingthe second port via a current-limiting element to the selected operatingvoltage which is higher or lower than the reference voltage, determiningthe time for the voltage change at the capacitor to reach the referencevoltage and evaluating the determined time as a measure for the voltageto be converted.

The object of the invention is further achieved by a device for theanalog/digital conversion of an electric voltage, the device including acapacitor having a first port which is connected to a fixed referencepotential (GND) and a second port for receiving the voltage to beconverted, a selector switch, an integrating resistor as acurrent-limiting element where the capacitor is connected to a voltagesource via the selector switch and the integrating resistor, acomparator for switching the selector switch to one of a plurality ofvoltage sources and comparing the voltage at the capacitor with areference voltage, wherein the direction of recharging the capacitor isdetermined by the selection of one of the plurality of voltage sources,and a time detector connected to the comparator for receiving thecomparator output signal and for determining the time for the voltagechange to reach the reference voltage at the capacitor wherein thedetermined time is evaluated as a measure for the voltage to beconverted.

Advantages of the invention

The process according to the invention for the analog/digital conversionof an electric signal has the advantage that a relatively high accuracycan be achieved, which only depends on the tolerance of a resistancecapacitor combination (RC component). One essential advantage is theparticularly cost-effective realization, which requires few structuralcomponents. Particularly suited for the realization of this invention isa microprocessor, which does not have to comprise an analog/digitalconverter as a result of the process according to the invention.

In a first process step, the capacitor for the RC component is chargedup to the voltage to be converted. In a second process step, thecapacitor is connected via a current-limiting component to a voltagesource, for which the voltage is higher or lower than a referencevoltage. In a third process step, the time for the voltage change at thecapacitor until the reference voltage is reached is determined. The timeis a measure for the voltage to be converted.

Other advantageous modifications and embodiments of the inventiveprocess for the analog/digital conversion of an electric signal canresult as described below.

One advantageous embodiment provides that the reference voltage isrealized with a comparator switching threshold. In the following, acomparator is also understood to be an input circuit of a logiccomponent, for example a microprocessor, which has at least one definedswitching threshold.

One advantageous modification of this measure provides that thecomparator has a switching hysteresis, wherein two different switchingthresholds develop. With this measure, it is possible to provide afurther reliable range for the voltage to be converted.

Another advantageous embodiment provides that the selection between thehigher or the lower voltage from the voltage source is provided independence on the comparator output signal. Having the control depend onthe comparator output signal ensures that the voltage at the comparator,starting with the voltage to be converted, can always reach thecomparator voltage.

Yet another advantageous further modification provides that one orpreferably two switching thresholds of the comparator are determinedadaptively. With this adaptive learning process, a high short-termstability and thus a high measuring accuracy can be achieved,independent of one or both of the switching thresholds for thecomparator.

The device according to the invention has the advantage of a verycost-effective realization. The capacitor as a current-limiting elementis connected via a resistor with a switch, which may have a high-ohmicswitching state. The reference voltage is realized as threshold for thecomparator.

Other advantageous embodiments and modifications of the device accordingto the invention for implementing the process for the analog/digitalconversion of an electric signal can result as described below.

One particularly advantageous embodiment provides that the switch, thecomparator as well as a time detector are components of amicroprocessor. As previously mentioned, the comparator is an inputcircuit that constitutes part of the microprocessor, behind amicroprocessor input port, which preferably has a hysteresis. Suchinputs are also called Schmitt Trigger Inputs. The RC element as well asan input resistor, if necessary, are the only external components stillnecessary.

Other advantageous embodiments and modifications of the processaccording to the invention for the analog/digital conversion of anelectric signal, as well as the device according to the invention forimplementing the process follow from the following description.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 shows a block diagram of a device according to the invention forimplementing a process for the analog/digital conversion of an electricsignal;

FIG. 2 illustrates a flow diagram which shows the process stepsaccording to the invention.

FIG. 3 to 5 show voltage courses for a capacitor shown in FIG. 1, independence on the time.

DESCRIPTION OF THE PREFERRED EMBODIMENTS

FIG. 1 shows a capacitor 10, which is respectively connected via aninput resistor 11 and integrating resistor 12 to a voltage U_(X) that isto be converted, and via the integrating resistor 12 to a selectorswitch 13, as well as to a comparator 14. The capacitor voltage U_(C) ispresent at capacitor 10. The comparator 14 can have a switchinghysteresis, which is symbolized by the sign entered into the comparator14.

The comparator 14 transmits a comparator output signal U_(COMP) to theselector switch 13 as to well as a time detector 15. The time detector15 transmits a resulting signal 16, which represents a measure for thevoltage U_(X) to be converted.

The selector switch 13 has three switching positions. A first positionconnects the integrating resistor 12 with a positive operating voltageU₊. A second position of the selector switch 13 corresponds to ahigh-ohmic state and a third switching position of the selector switch13 connects the integrating resistor 12 to a negative operating voltageGND.

The selector switch 13, the comparator 14 as well as the time detector15 are arranged in a microprocessor 17, to which the positive operatingvoltage U₊ as well as the negative operating voltage GND are fed.

Following an actuation or start 20, the flow diagram shown in FIG. 2starts with a first processing step 21 during which the capacitorvoltage U_(C) is charged up to the voltage U_(X) to be converted. Independence on an inquiry 22, which determines whether the comparatoroutput signal U_(COMP) shows a high level (H-level), there is achangeover either to a first or a second assignment 23, 24 during asecond processing step. For the first assignment 23, the capacitor 10 isconnected via a current-limiting element to the negative operatingvoltage GND and for the second assignment 24, the capacitor is connectedvia a current-limiting element to the positive operating voltage U₊.Following the first assignment 23, a first time detector 25 is provided,which determines a downward integration time T_(L) for which thecapacitor voltage U_(C) shows a reference voltage S_(L) from thecomparator 14, starting with the voltage U_(X) to be converted.Following the second assignment 24, a second time detector 26 isplanned, which determines an upward integration time T_(H) during whichthe capacitor voltage U_(C) reaches the reference voltage S_(H) ofcomparator 14, starting from the voltage U_(X) to be converted.

FIG. 3 shows two capacitor voltages U_(C) in dependence on the time t,which occur during an adaptive learning process of switching thresholdsfor comparator 14. The switching thresholds of comparator 14 correspondto reference voltages S_(L), S_(H) discussed above. A first curve shape30 starts with the negative operating voltage GND and approaches in anasymptotic way the positive operating voltage U₊ through charging viathe integrating resistor 12. The time that passes until the first curveshape 30 assumes the voltage U_(C), which corresponds to an upperswitching threshold S_(H) of comparator 14, for which the comparator 14switches from low level (L-level) to H-level, is designated as firstconstant time T_(KH). A lower switching threshold S_(L) of comparator 14is learned with the aid of the second curve shape 31, shown in FIG. 3.Starting with a capacitor voltage U_(C), which corresponds to thepositive operating voltage U₊, the capacitor 10 is discharged via theintegrating resistor 12 until it reaches asymptotically the negativeoperating voltage GND. The time that elapses until the comparator 14reaches the lowest switching threshold S_(L), for which the comparator14 switches from H-level to L-level, is referred to as the secondconstant time T_(KL).

A first signal curve 32 is shown in FIG. 4, for which the capacitorvoltage U_(C) reaches the upper switching threshold S_(H) of thecomparator 14, starting with a first voltage U_(x1) to be converted. Thetime within which the capacitor voltage U_(C) increases until it reachesthe upper switching threshold S_(H) of comparator 14, is designated asfirst conversion time T_(H).

FIG. 5 shows a second signal course 33, for which the capacitor voltageU_(C) reaches the lower switching threshold S_(L) of the capacitor 14,starting with a second voltage U_(x2) to be converted. The time duringwhich the capacitor voltage U_(C) reaches the lower switching thresholdS_(L) of comparator 14 is designated as second conversion time T_(L).

The process according to the invention is shown with the aid of theblock diagram shown in FIG. 1, in connection with the flow diagram shownin FIG. 2 as well as in connection with the signal courses shown inFIGS. 3 to 5:

Insofar as at least one switching threshold S_(H), S_(L) of comparator14 is not known, the at least one unknown switching threshold S_(H),S_(L) can be determined experimentally. A possibly existingmicroprocessor 17, which incorporates preferably the selector switch 13,the comparator 14 as well as the time detector 15, can be used suitablyat any time for the adaptive learning of the at least one unknownswitching threshold S_(H), S_(L) of comparator 14. The absolute value ofswitching threshold S_(H), S_(L) is of no importance for the processaccording to the invention. However, the first constant time T_(KH) orthe second constant time T_(KL) is essential. The two constant timesT_(KH), T_(KL) are a measure for the time constant of the RC component10, 12 that includes the capacitor 10 as well as the integratingresistor 12. The integrating resistor 12 is here used ascurrent-limiting element. A power source, for example is on principlealso suitable for such a current-limiting element.

The comparator 14 is preferably an input circuit of a logic switchingcircuit, which includes the at least one switching threshold S_(H),S_(L). Such an input circuit is, for example, located behind input portsof microprocessors. The two switching thresholds S_(H), S_(L), whichcorrespond to a hysteresis, have input ports as in a Schmitt TriggerInput. The output signal U_(COMP) of comparator 14 corresponds to theinternal logic signal of the input port.

The adaptive learning of the upper switching threshold T_(H) occurs inthat the first curve shape 30, which is shown in FIG. 3, ispredetermined. Starting with the no-voltage state of capacitor 10, thefirst selector switch 13 is switched to the positive operating voltageU₊. The capacitor voltage U_(C) subsequently increases from the startingvalue that corresponds to the negative operating voltage GND, inaccordance with the first curve shape 30. Once the upper switchingthreshold S_(H) of comparator 14 is reached, the comparator outputsignal U_(COMP) jumps from a L-level to a H-level. A precondition forthis is that the comparator output signal U_(COMP) shows the L-levelbelow the lower switching threshold S_(L) and an increasing capacitorvoltage does not switch to the H-level until the upper switchingthreshold S_(H) is reached. The two switching thresholds S_(H), S_(L),which are used as a basis here, are predetermined by a hysteresis value,which in integrated logic circuits is preset by the manufacturer. Thetime required by selector switch 13 for switching to the positiveoperating voltage U₊ and the time required by the comparator outputsignal U_(COMP) for changing from the L-level to the H-level correspondsto the first constant time T_(KH), which is stored in a memory that isnot shown in FIG. 1.

The following applies:

    S.sub.H =U.sub.+ *(1-exp(-T.sub.KH /RC))                   (equation 1)

wherein R represents the resistance of the integrating resistor 11 and Crepresents the capacitance value of the capacitor 10.

Correspondingly, the lower switching threshold S_(L) of the comparator14 can be learned with the aid of the second curve shape 31. The secondcurve shape 31 begins with a capacitor voltage U_(C), which correspondsto the positive operating voltage U₊. The approach of the second curveshape 31 to the negative operating voltage GND is caused by anintegration downward by the integrating resistor 12, which was switchedwith the aid of the selector switch 13 to the negative operating voltageGND. The time required for the switching operation of the selectorswitch 13 to the negative operating voltage GND and the ranges of thelower switching threshold S_(L) of the comparator 14 corresponds to thesecond constant time T_(KL), which is also stored in a memory that isnot shown in FIG. 1.

The following applies:

    S.sub.L =U.sub.+ *exp(-T.sub.KL /RC)                       (equation 2)

Insofar as only one switching threshold of the comparator 14 isprovided, either the first curve shape 30 or the second curve shape 31can be used as a basis for the adaptive learning of the switchingthreshold. It is only essential that the changeover from L-level toH-level or from H-level to L-level of the comparator output signalU_(COMP) is detected.

An analog/digital conversion starts with the actuation or start 20,shown in FIG. 2, after the at least one switching threshold S_(H), S_(L)of comparator 14 is known, wherein the at least one switching thresholdS_(H), S_(L) corresponds to a reference voltage. In the first processstep 21, the capacitor voltage U_(C) is charged up to the voltage U_(X)to be converted. The voltage U_(X) to be converted is transmitted viathe input resistor 11 (and integrating resistor 12) to the capacitor 10.The input resistor 11 can be selected large enough, so that fluctuationsof the voltage U_(X) to be converted at least approximately do notinfluence the conversion during the conversion. For another embodiment,a complete separation of the voltage U_(X) to be converted from thecapacitor 10 can be planned during the following process steps. Thecapacitor 10 is connected in a second process step via thecurrent-limiting element 12, for example the integrating resistor 12, toa voltage source with a voltage that is higher or lower than thereference voltage of the comparator 14, which corresponds to the atleast one switching threshold S_(H), S_(L). The integrating resistor 12can also be arranged in the line that leads to the selector switch 13,so that the input resistor 11 is located directly at the capacitor 10.In the exemplary embodiment shown, the predetermined voltages are thepositive operating voltage U₊ on the one hand and the negative operatingvoltage GND of the microprocessor 17 on the other hand.

The inquiry 22 is provided, if necessary, for which the selector switch13 is activated in dependence on the comparator output signal U_(COMP).Insofar as the comparator output signal shows the H-level, the selectorswitch 13 is switched to the negative operating voltage GND during thefirst assignment 23. If the comparator output signal U_(COMP) shows theL-level, the selector switch 13 is switched to the positive operatingvoltage U₊ during the second assignment 24. The above-describedpreconditions again apply for the level definition. On principle, it isnot necessary to activate the selector switch 13 in dependence on thecomparator output signal U_(COMP). A sequential, positively actuatedswitching back and forth between both voltages is also suitable, whereina level change of the comparator output signal U_(COMP) is achieved inany case in the following second process step. By making the control ofselector switch 13, if necessary, dependent on the comparator outputsignal U_(COMP), it is ensured that in the following second process stepa level change of comparator output signal U_(COMP) always occursfollowing a switching operation.

If the first voltage U_(x1) to be converted is so low that thecomparator output signal U_(COMP) shows L-level, then the selectorswitch is connected during the second process step according to thesecond assignment 24 to the positive operating voltage U₊. Starting withthe first converting voltage U_(x1) shown in FIG. 4, the capacitorvoltage U_(C) increases according to the first signal shape 32. Whenreaching the upper switching threshold S_(H) of the comparator 14, thecomparator output signal U_(COMP) switches from the L-level to theH-level. The time detector 15 determines the time that passes betweenthe switching of selector switch 13 to the positive operating voltage U₊until the upper voltage threshold S_(H) is reached, which is the same asthe first conversion time T_(H).

The following applies:

    S.sub.H =U.sub.x1 +(U.sub.+ -U.sub.x1)*(1-exp(-T.sub.KH /RC))(equation 3)

When equation 3 is set equal to equation 1, the following results areobtained:

    S.sub.H =UX1+(U.sub.+ -U.sub.x1)*(1-exp(-T.sub.KH /RC))

    =U.sub.+ *(1-exp(-T.sub.KH /RC))

From this follows for U_(x1) :

    U.sub.x1 =U.sub.+ *(1-exp(-T.sub.KH /RC))

From this, it follows that the first voltage U_(x1) to be converteddepends only on the first conversion time T_(H). The other values thatappear are known.

If the voltage U_(X) to be converted is high enough so that thecomparator output signal U_(COMP) shows the H-level, then the selectorswitch 13 is switched during the first assignment 23 in the secondprocess step to the negative operating voltage GND. The signal course 33shown in FIG. 5 starts accordingly with the second voltage U_(x2) to beconverted and subsequently drops to lower voltage values. When reachingthe lower switching threshold S_(L) of the comparator 14, the comparatoroutput signal changes from H-level to L-level. The time detector 15detects the time that has passed between the switching of selectorswitch 13 and the level change as second conversion time T_(L).

The following applies:

    S.sub.L =U.sub.x2 *exp(-T.sub.L /RC)                       (equation 4)

By setting equation 2 equal to equation 4, the following results:

    S.sub.L =U.sub.x2 *exp(-T.sub.L /RC)=U.sub.+ *(-T.sub.KL /RC)

From this it follows for U_(x2) :

    U.sub.x2 =U.sub.+ *exp(T.sub.L -T.sub.KL)/RC)

Thus, the second voltage to be converted U_(x2) only depends on thesecond conversion time T_(L). The other values are known.

The time detector 15, which determines either the first or the secondconversion time T_(H), T_(L), further transmits these times, whichalready constitute a measure for the electric signal to be converted, asresulting signal 16 for further calculation preferably within themicroprocessor 17, where the times T_(H) or T_(L) are converted, forexample, to a voltage data or a current data. The results of theexponential functions are preferably determined with tables, which arestored in a memory of microprocessor 17 that is not shown in moredetail.

I claim:
 1. A process for analog/digital conversion of an electricvoltage comprising the steps of:charging a capacitor up to a voltage tobe converted by transmitting said voltage to be converted to a secondport of the capacitor, the capacitor having a first port which isconnected to a fixed potential; comparing the voltage at the capacitorto a reference voltage and determining a recharging direction byselecting an operating voltage from a variable voltage source by using acomparator; recharging said capacitor by connecting the second port viaa current-limiting element to the selected operating voltage;determining the amount of time that passes between the selecting of theoperating voltage and reaching the reference voltage at the capacitor;and evaluating the determined time as a measure for the voltage to beconverted.
 2. The process according to claim 1, wherein the comparingstep uses the comparator to determine the reference voltage, saidcomparator having a switching hysteresis which results in an upperswitching threshold or reference voltage and a lower switching thresholdor reference voltage.
 3. The process according to claim 1, wherein thecomparing step further includes adaptive learning of the referencevoltage, the reference voltage being a switching threshold of thecomparator.
 4. A device for analog/digital conversion of an electricvoltage comprising:a capacitor having a first port connected to a fixedpotential and a second port for receiving the voltage to be converted; aselector switch; an integrating resistor as a current-limiting element,said capacitor being connected to one of a plurality of voltage sourcesvia the selector switch and the integrating resistor for recharging; acomparator for switching the selector switch to one of the plurality ofvoltage sources and comparing the voltage at the capacitor with areference voltage, wherein the direction of the recharging is determinedby the selection of one of the plurality of voltage sources; and a timedetector connected to the comparator for receiving the comparator outputsignal, the time detector determining the amount of time that passesfrom the selection of one of the plurality of voltage sources until thecapacitor reaches the reference voltage, wherein the determined time isevaluated as a measure for the voltage to be converted.
 5. The deviceaccording to claim 4 further comprising an input resistor and whereinthe voltage to be converted can be connected to the capacitor via theinput resistor.
 6. The device according to claim 4 wherein the selectorswitch exhibits a high-ohmic switching state.
 7. The device according toclaim 4 wherein the selected voltage from the plurality of voltagesources corresponds to a positive or negative operating voltage.
 8. Thedevice according to claim 4 further comprising a microprocessor andwherein the selector switch, the comparator and time detector arecomponents of the microprocessor.
 9. The device according to claim 10wherein the comparator constitutes an input circuit of a logic switchingcircuit.
 10. The device according to claim 9 further comprising amicroprocessor and wherein the input circuit is a component of an inputport for the microprocessor.
 11. The device according to claim 4 whereinthe comparator constitutes an input circuit of a logic switchingcircuit.
 12. The device according to claim 11 further comprising amicroprocessor and wherein the input circuit is a component of an inputport for the microprocessor.